package com.snooker.snooker.util;

import com.snooker.snooker.dto.GameForEventDto;
import java.util.List;

/**
 * @Description: 数据整合工具类
 * @Param:
 * @return:
 * @Author: fenghouzhi
 * @Date: 2:30 PM 2018/11/16
 */
public class DataFormatUtil {

  /**
   * 翻译球员名字
   */
  public static List<GameForEventDto> translatePlayerName(List<GameForEventDto> gameForEventDtos) {

    for (GameForEventDto gameForEventDto : gameForEventDtos) {
      gameForEventDto.setModDate(DateUtil.forStringToDate(gameForEventDto.getModDate()));
      gameForEventDto.setStartDate(DateUtil.forStringToDate(gameForEventDto.getStartDate()));
      gameForEventDto.setEndDate(DateUtil.forStringToDate(gameForEventDto.getEndDate()));
      gameForEventDto
          .setScheduledDate(DateUtil.forStringToDate(gameForEventDto.getScheduledDate()));

      if (gameForEventDto.getPlayer1ID() == 5) {
        gameForEventDto.setPlayer1Name("罗尼·奥沙利文");
      }

      if (gameForEventDto.getPlayer2ID() == 16) {
        gameForEventDto.setPlayer2Name("巴里·霍金斯");
      }
    }

    return gameForEventDtos;
  }
}
